package com.xkcoding.orm.mybatis.plus.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 逻辑错误检测规则
 *
 * @Author lingNan
 * @Date 2022/7/20 20:59
 **/
public enum LogicalErrorEnum {

    ;

    @Getter
    @AllArgsConstructor
    public enum LogicalErrorEnum_LEVEL1 implements IEnum {

        NO_DEAL(0, "不检测"),

        DEAL(1, "检测"),
        ;

        @JsonValue
        @EnumValue
        private final Integer value;

        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum LogicalErrorEnum_LEVEL2 implements IEnum {

        INTEGER(0, "检测是否整数"),

        DOUBLE(1, "检测小数精确位数"),

        BLANK(2, "检测是否有空格"),

        ;
        @JsonValue
        @EnumValue
        private final Integer value;

        private final String desc;


    }

    @Getter
    @AllArgsConstructor
    public enum CheckInteger implements IEnum {

        NO_DEAL(0, "请选择"),
        CHECK_NO_DEAL(1, "只检测，不处理"),
        UPWARD(2, "去掉千分符且向上取整"),
        DOWNWARD(3, "去掉千分符且向下取整"),
        ROUNDED(4, "去掉千分符且四舍五入取整"),

        ;

        @JsonValue
        @EnumValue
        private final Integer value;

        private final String desc;
    }

    @Getter
    @AllArgsConstructor
    public enum CheckDouble implements IEnum {

        NO_DEAL(0, "请选择"),
        CHECK_NO_DEAL(1, "只检测，不处理"),
        POINT_1(2, "精确到小数点后1位"),
        POINT_2(3, "精确到小数点后2位"),
        POINT_3(4, "精确到小数点后3位"),
        POINT_4(5, "精确到小数点后4位"),
        ;

        @JsonValue
        @EnumValue
        private final Integer value;

        private final String desc;

    }

    @Getter
    @AllArgsConstructor
    public enum CheckBlankSpace implements IEnum {

        NO_DEAL(0, "请选择"),
        ALL(1, "去掉所有空格"),
        LEFT(2, "去掉左空格"),
        RIGHT(3, "去掉右空格"),
        MIDDLE(4, "去掉中间空格"),
        ;

        @JsonValue
        @EnumValue
        private final Integer value;

        private final String desc;

    }
}
